Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Text.​Json.​Serialization.​Metadata.​JsonTypeInfo<​T>

Assembly: System.Text.Json

Inheritance: object → JsonTypeInfo → JsonTypeInfo

Provides JSON serialization-related metadata about a type.

Properties

public Func<​T>
CreateObject
Gets or sets a parameterless factory to be used on deserialization.
public Action<​Utf8JsonWriter, T>
SerializeHandler
Serializes an instance of <typeparamref name="T" /> using <see cref="T:System.Text.Json.Serialization.JsonSourceGenerationOptionsAttribute" /> values specified at design time.
public JsonConverter
Converter
Gets the <see cref="T:System.Text.Json.Serialization.JsonConverter" /> associated with the current type.
public Func<​object>
CreateObject
Gets or sets a parameterless factory to be used on deserialization.
ConstructorAttributeProvider
Gets or sets an attribute provider corresponding to the deserialization constructor.
public Type
ElementType
Gets the element type corresponding to an enumerable, dictionary or optional type.
public bool
IsReadOnly
Gets a value that indicates whether the current instance has been locked for modification.
public Type
KeyType
Gets the key type corresponding to a dictionary type.
Kind
Gets a value that describes the kind of contract metadata that the current instance specifies.
NumberHandling
Gets or sets the type-level <see cref="P:System.Text.Json.JsonSerializerOptions.NumberHandling" /> override.
public Action<​object>
OnDeserialized
Gets or sets a callback to be invoked after deserialization occurs.
public Action<​object>
OnDeserializing
Gets or sets a callback to be invoked before deserialization occurs.
public Action<​object>
OnSerialized
Gets or sets a callback to be invoked after serialization occurs.
public Action<​object>
OnSerializing
Gets or sets a callback to be invoked before serialization occurs.
Options
Gets the <see cref="T:System.Text.Json.JsonSerializerOptions" /> value associated with the current <see cref="T:System.Text.Json.Serialization.Metadata.JsonTypeInfo" /> instance.
OriginatingResolver
Gets or sets the <see cref="T:System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver" /> from which this metadata instance originated.
PolymorphismOptions
Gets or sets a configuration object specifying polymorphism metadata.
PreferredPropertyObjectCreationHandling
Gets or sets the preferred <see cref="T:System.Text.Json.Serialization.JsonObjectCreationHandling" /> value for properties contained in the type.
Gets the list of <see cref="T:System.Text.Json.Serialization.Metadata.JsonPropertyInfo" /> metadata corresponding to the current type.
public Type
Type
Gets the <see cref="P:System.Text.Json.Serialization.Metadata.JsonTypeInfo.Type" /> for which the JSON serialization contract is being defined.
UnmappedMemberHandling
Gets or sets the type-level <see cref="T:System.Text.Json.Serialization.JsonUnmappedMemberHandling" /> override.

Methods

CreateJsonPropertyInfo​(Type propertyType, string name)
Inherited from JsonTypeInfo
Creates a blank <see cref="T:System.Text.Json.Serialization.Metadata.JsonPropertyInfo" /> instance for the current <see cref="T:System.Text.Json.Serialization.Metadata.JsonTypeInfo" /> .
Returns A blank <see cref="T:System.Text.Json.Serialization.Metadata.JsonPropertyInfo" /> instance.
propertyType The declared type for the property.
name The property name used in JSON serialization and deserialization.
public void
MakeReadOnly​()
Inherited from JsonTypeInfo
Locks the current instance for further modification.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object